package com.cy.zs.hp.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cy.zs.hp.model.SchedulingTable;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 该表为医师排班表及候诊人数状态表 Mapper 接口
 * </p>
 *
 * @author cgb2008
 * @since 2020-11-28
 */

@Mapper
public interface SchedulingTableMapper extends BaseMapper<SchedulingTable> {
    /**
     * 显示所有数据
     */
    List<SchedulingTable> findxx();
    /**
     * 修改人数
     */
    int updatepeople(Integer number, Integer id,String time);
    /**
     * 查询该医生的剩余人数
     */
    Integer find1(Integer id, String time);
    /** 删除前一天的数据*/
    int deleteday();

    @Select("select * from scheduling_table where doctor_id=#{doctorId}")
    List<SchedulingTable> findByDoctorId(Integer doctorId);

    /**当人数满的时候删除当天的信息*/
    @Delete("delete from scheduling_table where surplus_number=#{number}")
    int deletepeople( Integer number);
}
